public class Test2 {
    public static void main(String[] args) {
        Integer[] arr={1,2,3,4,5,45,6,7};
        Alg<Integer> alg=new Alg<>();
        System.out.println(alg.findMax(arr));
    }
}
class Alg<E extends Comparable<E>>{
    public E findMax(E[] arr){
        E max=arr[0];
        for (int i = 1; i < arr.length ; i++) {
            if(arr[i].compareTo(max)>0){
                max=arr[i];
            }
        }
        return max;
    }
}
